package com.xiaobao.coalproperty.other.util;

import com.xiaobao.coalproperty.module.user.model.entity.CenterIndexEntity;
import com.xiaobao.coalproperty.other.constant.StringConstant;

public class UserHelperUtils {

    private static volatile UserHelperUtils mUserHelperUtils = null;
    private CenterIndexEntity mCenterIndexEntity;

    private UserHelperUtils() {
    }

    public synchronized static UserHelperUtils getInstance() {
        if (mUserHelperUtils == null) {
            mUserHelperUtils = new UserHelperUtils();
        }
        return mUserHelperUtils;
    }

    public CenterIndexEntity getCenter() {
        return mCenterIndexEntity;
    }

    public void setCenter(CenterIndexEntity mCenterIndexEntity) {
        this.mCenterIndexEntity = mCenterIndexEntity;
    }

    public void clearUser() {
        SharedPreferencesUtils.getInstance().put(StringConstant.USER_UID, -1 + "");
        SharedPreferencesUtils.getInstance().put(StringConstant.USER_HASHID, "");
        SharedPreferencesUtils.getInstance().put(StringConstant.USER_FACE, "");
        SharedPreferencesUtils.getInstance().put(StringConstant.USER_NICKNAME, "");
        SharedPreferencesUtils.getInstance().put(StringConstant.USER_PHONE, "");
    }

    public String getUid() {
        return (String) SharedPreferencesUtils.getInstance().get(StringConstant.USER_UID, "");
    }

    public String getHashId() {
        return (String) SharedPreferencesUtils.getInstance().get(StringConstant.USER_HASHID, "");
    }

    public String getFace() {
        return (String) SharedPreferencesUtils.getInstance().get(StringConstant.USER_FACE, "");
    }

    public String getNickName() {
        return (String) SharedPreferencesUtils.getInstance().get(StringConstant.USER_NICKNAME, "");
    }

    public String getPhone() {
        return (String) SharedPreferencesUtils.getInstance().get(StringConstant.USER_PHONE, "");
    }
}
